package com.yuji.aacar.core.cores.utils;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

/**
 * <li>Package:com.ttp.core.cores.utils
 * <li>Author: lining
 * <li>Date: 2017/2/23
 * <li>Description: app系统变量和系统功能的应用工具类
 */

public class CoreAppUtil {

    /**
     * 获取清单文件meda-data的值
     *
     * @param ctx
     * @param dataName meda-data的name
     * @return
     */
    public static String getMetaData(Context ctx, String dataName){
        String mData = "";
        ApplicationInfo appInfo = null;
        try {
            appInfo = ctx.getPackageManager().getApplicationInfo(ctx.getPackageName(),
                    PackageManager.GET_META_DATA);
            mData = appInfo.metaData.getString(dataName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mData;
    }
}
